﻿<UserControl x:Class="SubtitleMatcher.Client.FileSelectionModules.Views.FileSelectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:comm="clr-namespace:SubtitlesMatcher.Common.Parser;assembly=SubtitlesMatcher.Common"
             mc:Ignorable="d">
    <UserControl.Resources>
        <DataTemplate  DataType="{x:Type comm:MediaFileInfo}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.5*" />
                    <ColumnDefinition Width="0.5*" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0">Title:</TextBlock>
                <TextBox  Grid.Row="0" Grid.Column="1"  Text="{Binding TitleName}"></TextBox>

                <TextBlock  Grid.Row="1" Grid.Column="0">Version:</TextBlock>
                <TextBox  Grid.Row="1" Grid.Column="1" Text="{Binding VersionName}"></TextBox>

            </Grid>
        </DataTemplate>
        <DataTemplate DataType="{x:Type comm:TvShowMediaFileInfo}">

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.5*" />
                    <ColumnDefinition Width="0.5*" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0">Title:</TextBlock>
                <TextBox  Grid.Row="0" Grid.Column="1"  Text="{Binding TitleName}"></TextBox>

                <TextBlock  Grid.Row="1" Grid.Column="0">Version:</TextBlock>
                <TextBox  Grid.Row="1" Grid.Column="1" Text="{Binding VersionName}"></TextBox>
                <TextBlock  Grid.Row="2" Grid.Column="0">Season:</TextBlock>
                <TextBox  Grid.Row="2" Grid.Column="1" Text="{Binding Season}"></TextBox>
                <TextBlock  Grid.Row="3" Grid.Column="0">Episode:</TextBlock>
                <TextBox  Grid.Row="3" Grid.Column="1" Text="{Binding Episode}"></TextBox>

            </Grid>

        </DataTemplate>
    </UserControl.Resources>
    <StackPanel Orientation="Vertical">
        <TextBlock Text="Please select movie/tv show file(s):" FontSize="15"/>
        <StackPanel Orientation="Horizontal">
            <ListBox ItemsSource="{Binding Path=FileNames}" Width="450" MaxHeight="200" />

            <Button Command="{Binding Path=BrowseDelegateCommand}">...</Button>

        </StackPanel>
        <CheckBox IsChecked="{Binding OverrideFileName}">Specify media file properties manually (select only one file)</CheckBox>
        <Border BorderBrush="AliceBlue" BorderThickness="3" CornerRadius="2,2,2,2">
            <StackPanel IsEnabled="{Binding OverrideFileName}">
                <CheckBox IsChecked="{Binding IsTvShow}">Is TV Show</CheckBox>
                <ContentControl Content="{Binding MediaFileInfo}"  >
                </ContentControl>
            </StackPanel>
        </Border>


    </StackPanel>
</UserControl>
